package com.baichang.taoshunda.entity.em;

public enum OrderState {

    待付款(1), 待接单(2), 待配送(3), 配送中(4), 待评价(5), 已完结(6), 申请退款(7),
    拒绝接单(8), 同意退款(9), 拒绝退款(10), 用户取消(11), 待取货(12), 申请退货(13),
    同意退货(14), 拒绝退货(15), 货物已归还商家(16), 申请换货(17), 等待用户自提(20), 同意换货(18), 拒绝换货(19);

    private Integer code;

    private OrderState(Integer code) {
        this.code = code;
    }

    public static OrderState valueOfCode(Integer code) {
        OrderState[] states = OrderState.values();
        for (OrderState state : states) {
            if (state.getCode().equals(code)) {
                return state;
            }
        }
        return null;
    }

    public Integer getCode() {
        return this.code;
    }

    @Override
    public String toString() {
        return String.valueOf(this.code);
    }

}
